﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PGBT
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            new LoginForm().ShowDialog();
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Thoát chương trình ?", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (result == DialogResult.OK)
            {
                Close();
            }
        }

        private void banHangToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            new FormBanHang().ShowDialog();
        }

        private void quanLyNguoiDungToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new QuanLyNguoiDung().ShowDialog();
        }

        private void xemDanhMucToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void cauHinhHeThongToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new CauHinhHeThong().ShowDialog();
        }

        private void dangNhapToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void doiMatKhauToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DoiMatKhau().ShowDialog();
        }

        private void danhMucSanPhamToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XemDanhMuc(0);
        }

        private void danhMucKhachHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XemDanhMuc(1);
        }

        private void danhMucNhapHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XemDanhMuc(2);
        }

        private void danhMucTraHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XemDanhMuc(3);
        }

        private void danhMucNhaCCToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XemDanhMuc(4);
        }

        private void quanLyKhachHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DanhMucKhachHang().ShowDialog();
        }

        private void quanLySanPhamToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DanhMucChiTietSanPham().ShowDialog();
        }

        private void quanLyDatHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DanhMucDatHang().ShowDialog();
        }

        private void quanLyNhapHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DanhMucNhapHang().ShowDialog();
        }

        private void quanLyTraHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DanhMucTraHang().ShowDialog();
        }

        private void nhaphangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new FormNhapHang().ShowDialog();
        }

        private void traHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new FormTraHang().ShowDialog();
        }

        private void quanLyNhaCungCapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DanhMucNhaCungCap().ShowDialog();
        }

        private void quanLyBanHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DanhMucBanHang().ShowDialog();
        }

        private void datHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new FormDatHang().ShowDialog();
        }

        private void XemDanhMuc(int i)
        {
            ThongTinDanhMuc frm = new ThongTinDanhMuc();
            frm.Text = Convert.ToString(i);
            frm.ShowDialog();
        }
    }
}
